package com.miplus.ccrm.core.service.crd;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.miplus.ccrm.core.controller.vo.credit.CaseCsBillPageReqVo;
import com.miplus.ccrm.core.controller.vo.credit.CaseCsBillPageResVo;
import com.miplus.ccrm.core.pojo.IouCaseCsBill;
import com.miplus.ccrm.core.service.crd.IouCaseCsBillService;
import com.miplus.ccrm.core.mapper.IouCaseCsBillMapper;
import org.springframework.stereotype.Service;

/**
* @author Yaohui
* @description 针对表【iou_case_cs_bill(借据清单信息(法诉))】的数据库操作Service实现
* @createDate 2025-03-31 10:59:51
*/
@Service
public class IouCaseCsBillServiceImpl extends MPJBaseServiceImpl<IouCaseCsBillMapper, IouCaseCsBill>
    implements IouCaseCsBillService{

    @Override
    public IPage<CaseCsBillPageResVo> caseCsBillPage(CaseCsBillPageReqVo reqVo) {
        return selectJoinListPage(new Page<>(reqVo.getPageNum(),reqVo.getPageSize()),CaseCsBillPageResVo.class,
                    new MPJLambdaWrapper<>(IouCaseCsBill.class)
                            .selectAll(IouCaseCsBill.class)
                            .selectAs("fun_getnames('FS.CASE.STATUS',status)", CaseCsBillPageResVo::getStatusDsc)
                            .in(reqVo.getLoanSerialNoList()!=null && reqVo.getLoanSerialNoList().size()>0,IouCaseCsBill::getLoanSerialNo,reqVo.getLoanSerialNoList())
        );
    }
}




